]\section{scalar --- Scalar Conversion}
\label{fn:scalar}
\index{scalar()}
\index{scalar conversion}
\index{matrix!conversion to scalar}
\begin{rail}
Scalar : 'scalar' '(' ( () | Scalar | Matrix ) ')' ;
\end{rail}

\verb+scalar+ converts its argument to a scalar.  If no argument is
supplied, then $0$ is returned. If the argument is a scalar, that
scalar is returned. If the argument is a matrix, the matrix must have
a single element, which is returned.

\verb+scalar+ is provided for symmetry with the \verb+matrix+
function. Functionally it is not required, since scalar
references to matrices are automatically converted to scalar
type.

\paragraph{Example}
\index{example of scalar()}
\index{scalar()!example}
\begin{verbatim}
> scalar()
        0
> scalar(2)
        2
> scalar(2.3462+365.365j)
     2.35 + 365i
> scalar([1.3242e-21])
 1.32e-21
\end{verbatim}

See also: Page~\pageref{fn:matrix} \verb+matrix()+.

\newpage


